package motionControl;

import java.io.BufferedReader;

import java.io.OutputStream;



public class TestBis implements Runnable {

	public static BufferedReader input;
	public static OutputStream output;
	public static String value;
	
	public static synchronized void writeData(String data) {
		System.out.println("Sent: " + data);

		try {
			output.write(data.getBytes());
		} catch (Exception e) {
			System.out.println("could not write to port");
		}
	}



	private char[] k;

	public static void  setValue(int i){
		int k = i;
		value = String.valueOf(k);
	}
	
	
	
	public void run() {
		// TODO Auto-generated method stub
		{

			try {

				SerialClass obj = new SerialClass();
				obj.initialize();
				input = SerialClass.input;
				output = SerialClass.output;

				writeData(value);

				String inputLine = input.readLine();
				System.out.println(inputLine);

				obj.close();
			} catch (Exception e) {
			}

		}
	}

}
